package com.itsu.graph_v2.service.impl;

import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.itsu.graph_v2.entity.Dept;
import com.itsu.graph_v2.mapper.DeptMapper;
import com.itsu.graph_v2.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeptServiceImpl implements DeptService {

    @Autowired
    DeptMapper deptMapper;

    @Override
    public List<Dept> findAll() {
        return deptMapper.selectList(Wrappers.query());
    }

    @Override
    public Dept findById(Integer id) {
        return deptMapper.selectById(id);
    }

    @Override
    public int addDept(Dept dept) {
        return deptMapper.insert(dept);
    }

}
